package fr.playsoft.psas;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

public class HorizontalPagerAct extends Activity {
    
	private HorizontalPager mPager;
	private TextView tvPagerIndex;
	
	/** Called when the activity is first created. */
	public void onCreate(Bundle icicle) {
		super.onCreate(icicle);
				
		setContentView(R.layout.hpager_layout);
		
		setupPager();
	}

	private void setupPager() {
		mPager = (HorizontalPager) findViewById(R.id.myhorizontal_pager);
        mPager.setOnScreenSwitchListener(onScreenSwitchListener);
        
        tvPagerIndex = (TextView) findViewById(R.id.hpager_index);
        tvPagerIndex.setText("Page 1/3");
		
	}
	
	private final HorizontalPager.OnScreenSwitchListener onScreenSwitchListener =
	        new HorizontalPager.OnScreenSwitchListener() {
        public void onScreenSwitched(final int screen) {
            // Check the appropriate button when the user swipes screens.
        	tvPagerIndex.setText("Page " + (screen + 1) + "/3");
        }
    };
	
}